import OSS from '../src/index';

(async () => {
  // const ossclient = new OSS({
  //   region: 's3',
  //   bucket: 'pl-test',
  //   endpoint: 'http://8.154.16.78:9000',
  //   accessKeyId: 'YsvztrHrp7cnaqxKk9sl',
  //   accessKeySecret: '8XD8npCJxlcY5prIsJsnP2daHCy9Ei0uT5BQMxQm',
  // });
  const ossclient = new OSS({
    region: 's3',
    accessKeyId: "YMazkh3beN0JP562Dk9U",
    accessKeySecret: "yLAxlf5IpcNMjXK5xCmbYTog8S39cYBd7rrziGFQ",
    endpoint: "http://8.154.16.78:9800",
    bucket: "pl-test",
  })
  // const ossclient = new OSS(
  //   {
  //     "stsToken": "CAIS5wJ1q6Ft5B2yfSjIr5DYBsvk3Ixz3oy9RkDjp1FnX99HtZHzpjz2IHhMfHFvCeAetv0ynGBW6/8YloNsQphMRAmYPMAv4M4M+EatPIbM/pC7tuNBgc3+Ry3DVEOmhZHfO+vyF4iFxABE+YuexEFJ2rLfWWiIfT7MaO+k6/NOatAQQXPLD15vD8tXIQ1PsdITMWCrW9+mLh/thBi7biMqwH0e71ly8qOi2MaRxwPDhVnhsI8vqp/2P4KvYrsHXv49ca/shbMrJvWYjncLukEUqfkstsEep2eb5OP6KkJK/hCLP9DT9tBSNwJjbsA4YfUc9KCkyq0o4rSKytynlUsUZ/ssWCDeSYa8hczfA6a0LtI+fLrrwbdANBdJ1fMf2iFTghJzXGsiE7JJoc+ug6CL7x/wng62Kv27gxYiOkl06ttC9bBf4VsmgzRkWRYBPRu3n0hmNHHCDScKcypy9wiH1sfnpzMSLTsPbxqAAZASRo7db3R5YcMH47FouLoZvfFL4ickSmHTj/e4ECMYjXJ+3VGe6lacyqICgl4bj5sr0rosCYd/pPcCO8cMBc52MnWOAQIakSe02VFcfUVj9qk49UqCmb/+f6fZGfTOvGXYTxzXlUE5ibovdbXpQ8f8S0P0Pynz8JVaDhQValG1IAA=",
  //     "accessKeySecret": "HfGF3bHQAZiytuhCaAwCM64X88vYWYy4Lvq52DZUJE31",
  //     "accessKeyId": "STS.NSmMqP1SRiNVDfRCQ2SPkZTXD",
  //     "endpoint": "oss-cn-hangzhou.aliyuncs.com",
  //     "bucket": "knowledge-pl",
  //     region: 'oss-cn-hangzhou'
  //   }
  // )
  const saveKey = 'unc-emails/test445.txt'
  // const signUrl = await ossclient.signatureUrl(saveKey, { expires: 3600 });
  // console.log('signUrl', signUrl)
  const res = await ossclient.put(saveKey, 'hello world');
  console.log(res);
  await ossclient.putACL(saveKey, 'private');
})();